#@layout(_res.get("indexPage"))
# define css()
<link rel="stylesheet" href="/view/main/index.css">
#end

# define js()
<script src="/view/main/index.js"></script>
#end



#define main()
<div class="content">
    #@article()
    #@article()
    #@article()
    #@article()
</div>
<div class="sidebar">
    #if(currentUser)
        #@userSidebar(currentUser.user_name)
        #@adminBtnSidebar()
    #else
    #@userSidebar("未登录")
        #@loginBtnSidebar()
    #end
</div>
#end








#define article()
<div class="post layui-radius">
    <div>
        <h1 class="post-title"><a href="#">我的第一篇博客</a></h1>
        <p class="post-meta">
            <time class="post-date" datetime="2017-04-28">2017年4月28日</time>
            <em>in</em>
            <a href="#">JiaJianChang</a>
        </p>
    </div>
    <div class="post-imgage">
        <img src="/img/post001.jpg">
    </div>
    <p>自己写的自适应页面~~啦啦啦啦#(abcd)</p>
</div>
#end

#define userSidebar(username)
<div class="userSidebar layui-radius">
    <div class="userSidebar-imgage  layui-circle">
        <div class="userSidebar-info layui-circle layui-hide">
            <a src="#">#(username)</a>
        </div>
    </div>
</div>
#end


#define adminBtnSidebar()
<div class="btuSidebar-btnGroup layui-radius">
    <a class="layui-btn layui-btn-radius layui-btn-normal" href="#" >#(_res.get("MyWebApp.Manage.Home"))</a>
    <a class="layui-btn layui-btn-radius layui-btn-normal" href="/manage/index">#(_res.get("MyWebApp.Manage.Manage"))</a>
</div>
#end
#define loginBtnSidebar()
<div class="btuSidebar-btnGroup layui-radius">
    <a class="layui-btn layui-btn-radius layui-btn-normal" href="/userlogin/login" >#(_res.get("MyWebApp.Login.signIn"))</a>
    <a class="layui-btn layui-btn-radius layui-btn-normal" href="/userlogin/register">#(_res.get("MyWebApp.Login.signUp"))</a>
</div>
#end
